package demo1;


public class Test {

    public static void shape(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        Shape cycle = new Cycle();
        Shape flower = new Flower();
        Shape rect = new Rect();
        Shape triangle = new Triangle();

        Shape[] shapes = {cycle,cycle,flower,flower,rect,triangle,triangle};

        for (Shape x:shapes) {
            x.draw();
        }

        /*String[] shapes = {"Cycle", "Cycle", "Flower", "Rect", "Rect", "Triangle"};
        for (String x : shapes) {
            if (x.equals("Cycle")) {
                cycle.draw();
            } else if (x.equals("Flower")) {
                flower.draw();
            } else if (x.equals("Rect")) {
                rect.draw();
            } else if (x.equals("Triangle")) {
                triangle.draw();
            }
        }*/

/*
        Shape[] shapes={cycle,cycle,flower,flower,rect,triangle,triangle};
        for (Shape x:shapes) {
            shape(x);
        }
*/

    }
}
